﻿using System;
using System.Collections.Generic;

namespace App.Utility
{
    public interface IRuleEntity
    {
        List<RuleViolation> GetRuleViolations();
    }


    public class RuleViolation
    {
        public string PropertyName { get; set; }
        public object PropertyValue { get; set; }
        public string ErrorMessage { get; set; }

        //public RuleViolation(string propertyName, object propertyValue, string errorMessage)
        //{
        //    PropertyName = propertyName;
        //    PropertyValue = propertyValue;
        //    ErrorMessage = errorMessage;
        //}
    }


    public class RuleViolationException : Exception
    {
        public List<RuleViolation> RuleValidationIssues { get; private set; }

        public RuleViolationException(string message, List<RuleViolation> rules)
            : base(message)
        {
            RuleValidationIssues = rules;
        }
    }
}
